      FUNCTION ARCTAN(X,Y)
      DOUBLE PRECISION ARCTAN, X, Y
      ARCTAN = DATAN2(X,Y)
      IF (ARCTAN .LT. 0.0D0) ARCTAN = ARCTAN + 6.283185307179586D0
      RETURN
      END
